package java0511;

//import java.util.*;
//
//// 牛客网: 洗牌
//public class Main{
//    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//        int lamp = sc.nextInt();
//        for (int i = 1; i <= lamp; i++) {
//            int count = sc.nextInt();
//            int k = sc.nextInt();
//            int[] cards = new int[2 * count];
//            for(int j = 0; j < 2 * count; j++) {
//                cards[j] = sc.nextInt();
//            }
//            func(cards, count, k);
//            System.out.println();
//        }
//    }
//
//    public static void func(int[] cards, int count, int k) {
//        Queue<Integer> sum = new LinkedList<>();
//        Queue<Integer> up = new LinkedList<>();
//        Queue<Integer> down = new LinkedList<>();
//        for (int i = cards.length - 1; i >= 0; i--) {
//            sum.offer(cards[i]);
//        }
//        for (int i = 1; i <= k; i++) {
//            for(int j = 0; j < count; j++) {
//                down.offer(sum.poll());
//            }
//            for(int j = 0; j < count; j++) {
//                up.offer(sum.poll());
//            }
//            for(int j = 0; j < 2 * count; j++) {
//                if(j % 2 == 0) {
//                    sum.offer(down.poll());
//                } else {
//                    sum.offer(up.poll());
//                }
//            }
//        }
//        int[] ret = new int[2 * count];
//        for (int i = ret.length - 1; i >= 0; i--) {
//            ret[i] = sum.poll();
//        }
//        for (int i = 0; i < ret.length - 1; i++) {
//            System.out.print(ret[i] + " ");
//        }
//        System.out.print(ret[ret.length - 1]);
//    }
//}

import java.util.Scanner;

// 牛客网: MP3
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int count = sc.nextInt();
            // 吸收空格
            sc.nextLine();
            String oper = sc.nextLine();
            func(count, oper);
        }
    }

    public static void func(int count, String oper) {
        int cur = 1;
        if (count <= 4) {
            for (int i = 1; i <= count - 1; i++) {
                System.out.print(i + " ");
            }
            System.out.println(count);
            for (int i = 0; i < oper.length(); i++) {
                if (oper.charAt(i) == 'U') {
                    cur--;
                    if (cur <= 0) {
                        cur = count;
                    }
                } else{
                    cur++;
                    if (cur > count) {
                        cur = 1;
                    }
                }
            }
            System.out.println(cur);
        } else {
            int pageUp = 1;
            int pageDo = 4;
            // 处理操作
            for (int i = 0; i < oper.length(); i++) {
                if (oper.charAt(i) == 'U') {
                    cur--;
                    if (cur <= 0) {
                        cur = count;
                        pageDo = count;
                        pageUp = count - 3;
                        continue;
                    }
                    if (cur < pageUp) {
                        pageUp--;
                        pageDo--;
                    }
                } else {
                    cur++;
                    if (cur > count) {
                        cur = 1;
                        pageUp = 1;
                        pageDo = 4;
                        continue;
                    }
                    if (cur > pageDo) {
                        pageUp++;
                        pageDo++;
                    }
                }
            }
            for (int i = pageUp; i <= pageDo - 1; i++) {
                System.out.print(i + " ");
            }
            System.out.println(pageDo);
            System.out.println(cur);
        }
    }
}
